﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using University.Workshop.Presenters.Cistern.Modify;

namespace University.Workshop.Presentation.Cistern.Modify
{
    /// <summary>
    /// Interaction logic for ModifyCisternPrincipal.xaml
    /// </summary>
    public partial class ModifyCisternPrincipal : Page, Presenters.Cistern.Modify.IModifyPrincipalView
    {
        PresenterModifyCistern pModifyCisternView;

        public ModifyCisternPrincipal(Model.Cistern cistern)
        {
            InitializeComponent();
            this.pModifyCisternView = new PresenterModifyCistern(this, cistern);
        }

        private void Page_Loaded(object sender, RoutedEventArgs e)
        {
            frmContent.Navigate(new PageFirstStepModifyCisternView(pModifyCisternView));
            pModifyCisternView.FirstTime();
        }

        private void GoStepOne_Click(object sender, RoutedEventArgs e)
        {
            pModifyCisternView.GoStepOne();
        }

        private void GoStepTwo_Click(object sender, RoutedEventArgs e)
        {
            pModifyCisternView.GoStepTwo();
        }

        private void btnCancelRegister_Click(object sender, RoutedEventArgs e)
        {
            this.NavigationService.Navigate(new SearchCistern());
        }

        private void btnModifyCistern_Click(object sender, RoutedEventArgs e)
        {
            pModifyCisternView.ModifyCistern();
        }

        private void btnBack_Click(object sender, RoutedEventArgs e)
        {
            pModifyCisternView.GoBackPage();
        }

        private void btnNext_Click(object sender, RoutedEventArgs e)
        {
            pModifyCisternView.GoNextPage();
        }


        public void CallFirstPage()
        {

            PageSecondStepModifyCisternView pp = new PageSecondStepModifyCisternView(pModifyCisternView);
            ModifyBasic = pp;
            frmContent.NavigationService.Navigate(pp);
            
        }


        public void CallSecondPage()
        {
            PageFirstStepModifyCisternView pp = new PageFirstStepModifyCisternView(pModifyCisternView);
            ModifyBasic = pp;
            frmContent.NavigationService.Navigate(pp);
            GoStepTwo.IsEnabled = true;
        }



        public void SystemMessage(string MessageValue)
        {
            MessageBox.Show(App.Current.MainWindow, MessageValue, "Atencion!!!", MessageBoxButton.OK, MessageBoxImage.Information, MessageBoxResult.OK, MessageBoxOptions.RightAlign);
        }

        public void ErrorMessage(string MessageValue)
        {
            MessageBox.Show(App.Current.MainWindow, MessageValue, "Error!!!", MessageBoxButton.OK, MessageBoxImage.Error, MessageBoxResult.OK, MessageBoxOptions.RightAlign);
        }


        public IModifyBasicCisternView ModifyBasic
        {
            get;
            set;

        }

        public void ReturnSearchCistern()
        {
            this.NavigationService.Navigate(new SearchCistern());
        }

    }
}
